import Request from '@/libs/request'
import qs from 'qs'

// 使用枚举包含所有path
enum Api {
  // 平台子用户查询设备坐标
  selectDevCoordinate = '/user/select/devBaseData',
  // 平台子用户修改设备坐标
  editDevCoordinate = '/user/edit/coordinate',
  // 查询摄像头坐标列表 
  selectCameraList = '/platFormSubUser/select/cameraList',
  // 修改摄像头坐标
  editCameraCoordinate = '/platFormSubUser/edit/cameraCoordinate'
}


// 平台子用户查询设备坐标的Api
export const selectDevCoordinateApi = (data: { userId: string }) => {
  return Request.post(Api.selectDevCoordinate, qs.stringify(data))
}


// 平台子用户修改设备坐标
export const editDevCoordinateApi = (data: { devBaseDataId: number, longitude: number, latitude: number }) => {
  return Request.post(Api.editDevCoordinate, qs.stringify(data))
}



// 查询摄像头的坐标列表的Api
export const selectCameraListApi = (data: { platFormSubUserId: string | number }) => {
  return Request.post(Api.selectCameraList, qs.stringify(data))
}

// 修改摄像头坐标的Api
export const editCameraCoordinateApi = (data: { cameraId: string | number, longitude: string, latitude: string }) => {
  return Request.post(Api.editCameraCoordinate, qs.stringify(data))
}

